import { createStore } from 'vuex'
// 导入持久化插件
import createPersistedState from "vuex-persistedstate";

import cart from "./modules/card"
export default createStore({
  modules: {
    cart
  },
  plugins: [createPersistedState({
    //指定数据被存储在哪里，当值为window.localStorage则表示存储在localStorage中，当值为window.sessionStorage则表示存储在sessionStorage中
    storage: window.localStorage,
    key: 'sellcard',
    paths: ["cart"]
  })],

})
